← Back
Editing: redirect.js
import{ff as e,bL as a,fg as t,a7 as s,b as l,a8 as r,W as o,j as i}from"./utils-lib.js?v=1765440387";import{_ as n}from"./index104.js?v=1765440387";import{B as p}from"./index141.js?v=1765440387";import{c as m,G as d,q as u,v as c,e as f,A as h,x as b,D as j,B as v,M as y,C as x,y as _,H as C,P as g}from"./base-lib.js?v=1765440387";import{a as k,b as B,u as V}from"./column.js?v=1765440387";import{u as H}from"./useStore4.js?v=1765440387";import{u as S,i as q,f as w,g as L,a as R,e as T,j as U,h as A,b as D,s as E,c as F,d as G,k as M}from"./useController16.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./ace.js?v=1765440387";import"./index105.js?v=1765440387";import"./site.js?v=1765440387";const P={class:"h-full"},W={class:"p-[20px]"},z=m({__name:"redirect",setup(m){const z=l(),{siteType:I}=H(),{isRefreshList:J}=S(),K=r([{label:"启用重定向规则",value:"start",event:M},{label:"停用重定向规则",value:"stop",event:M},{label:"删除重定向规则",value:"delete",event:M}]),{BtTable:N,BtRefresh:O,BtBatch:Q}=e({request:q,columns:[k(),{label:"被重定向",render:e=>{var t;return e.errorpage?"404错误页面":"domain"===e.domainorpath?null==(t=a(e.redirectdomain,"array",[]))?void 0:t.join("、"):e.redirectpath}},{label:"重定向类型",prop:"domainorpath",render:e=>e.errorpage?"错误":"domain"===e.domainorpath?"域名":"路径"},{label:"重定向到",render:e=>e.topath?e.topath:e.tourl},B({prop:"type",event:w,data:["已停止","运行中"]}),V([{width:70,title:"配置文件",onClick:e=>{if(!e.type)return z.warn("请先启用重定向规则再查看配置文件");L(e)}},{title:"编辑",onClick:e=>{e.errorpage?R(e):T(e)}},{onClick:U,title:"删除"}])],extension:[t(),K,s(J)]});return(e,a)=>{const t=n,s=o,l=i,r=d("bt-loading");return u(),c("div",P,[f(t,null,{"header-left":h((()=>[f(b(j),{type:"primary",onClick:a[0]||(a[0]=e=>b(T)())},{default:h((()=>a[6]||(a[6]=[v("添加重定向")]))),_:1}),["php","html"].includes(b(I))?(u(),y(b(j),{key:0,type:"default",onClick:a[1]||(a[1]=e=>b(R)())},{default:h((()=>a[7]||(a[7]=[v("404重定向")]))),_:1})):x("",!0)])),"header-right":h((()=>[f(b(O))])),content:h((()=>[f(b(N),{"max-height":460})])),"footer-left":h((()=>[f(b(Q))])),_:1}),f(s,{class:"mt-2rem",options:b(A),"list-style":"disc"},null,8,["options"]),f(l,{title:"编辑配置文件",modelValue:b(G),"onUpdate:modelValue":a[5]||(a[5]=e=>g(G)?G.value=e:null),area:54},{default:h((()=>[_("div",W,[a[9]||(a[9]=v(" 提示:Ctrl+F 搜索关键字,Ctrl+S 保存,Ctrl+H 查找替换 ")),C(f(b(p),{class:"!h-[36rem] my-[8px]",ref:"aceEditor",modelValue:b(D),"onUpdate:modelValue":a[2]||(a[2]=e=>g(D)?D.value=e:null),onSave:a[3]||(a[3]=e=>b(E)())},null,8,["modelValue"]),[[r,b(F)]]),f(b(j),{type:"primary",onClick:a[4]||(a[4]=e=>b(E)())},{default:h((()=>a[8]||(a[8]=[v("保存")]))),_:1}),a[10]||(a[10]=_("ul",{class:"mt-[8px] leading-8 text-[1.2rem] list-disc ml-[20px]"},[_("li",null,"此处为该重定向的配置文件,若您不了解配置规则,请勿随意修改。")],-1))])])),_:1},8,["modelValue"])])}}});export{z as default};
Save File
Cancel